//
//  UIButton+Layout.h
//  LearnTeacher
//
//  Created by zyl_macbookpro on 2024/4/9.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
// 定义一个枚举（包含了四种类型的button）
typedef NS_ENUM(NSUInteger, LButtonEdgeInsetsStyle) {
    LButtonEdgeInsetsStyleTop, // image在上，label在下
    LButtonEdgeInsetsStyleLeft, // image在左，label在右
    LButtonEdgeInsetsStyleBottom, // image在下，label在上
    LButtonEdgeInsetsStyleRight // image在右，label在左
};

@interface UIButton (Layout)

/**
 *  设置button的titleLabel和imageView的布局样式，及间距
 *
 *  @param style titleLabel和imageView的布局样式
 *  @param space titleLabel和imageView的间距
 */
- (void)layoutButtonWithEdgeInsetsStyle:(LButtonEdgeInsetsStyle)style
                        imageTitleSpace:(CGFloat)space;

@end

NS_ASSUME_NONNULL_END
